package com.dzh.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;

//在templates目录下的所有html页面，只能通过controller来跳转
//这个需要模板引擎的支持！如thymeleaf，freemaker
@Controller
public class IndexController {

    @RequestMapping("/test")
    public String test(Model model) {
        model.addAttribute("msg","helloword");
        model.addAttribute("users", Arrays.asList("dzh","knny"));
        return "test";
    }

}
